Added validations for both client and server side