added server side validation for input fields