Massachusetts’ highest court has ruled that a state law restricting secret videos or photographs of nude or partially nude people does not ban “upskirting”—taking covert pictures under a woman’s dress or skirt in public.

The Massachusetts Supreme Judicial Court issued the ruling on Wednesday in Commonwealth v. Robertson, reversing a Boston Municipal Court judge’s denial of a defense dismissal motion. Michael Robertson was caught taking such photos on a Massachusetts Bay Transportation Authority subway train in August 2010.