added some validation functions