Added some basic input validation