added server-side validations