validations and exception handling