LOCKPORT – A man who flunked out of court-supervised treatment programs for drug addiction and mental illness was sentenced to three years in prison Wednesday by Niagara County Judge Sara Sheldon Farkas.

Thomas J. Anderson, 40, of Wheatfield Street, had pleaded guilty last year to fifth-degree criminal possession of a controlled substance, for having cocaine with him when North Tonawanda police stopped his car March 7, 2011.

At first, Anderson was assigned to the judicial diversion program of court-supervised drug treatment, but after failing there, Farkas placed him in Niagara Falls mental health court. He failed to follow its rules, too.

“I hear voices all day, every day,” Anderson said in court Aug. 20. “The only way they stop is when I take drugs.”