implementing user input error checking in Controller