working validations and errors