adds more input validation