Added some validation