added some error printouts