corrected input error catching