adds error handling at input methods