Added some validation functions