handles input errorsw