added printouts for errors