updated error printing