updated error validation