validations on client and server side