NESCONSET, N.Y. (CBSNewYork) — A St. James man has been arrested for burglarizing a doctor’s office after he was caught trying to fill forged prescriptions at two local pharmacies on Friday, police said.

Police say 41-year-old Andre Machate tried to get a prescription filled at a Smithtown CVS shortly before 3 p.m. and fled after the pharmacist became suspicious of its authenticty.

Machate then allegedly went to another CVS in Nesconset, but was arrested when he returned to pick up his prescription.

Detectives recovered the forged prescription and a blank prescription pad that police said Machate had stolen from a doctor’s office last year.

Police said Machate broke into the doctor’s office by smashing a glass window near the front door on Nov. 28, 2011.

Machate has been charged with burglary, forgery and criminal possession of stolen property.

Watch & Listen LIVE