added input fields validation