Added some input validation for fields