validation and exceptions