added error printout