added simple form validation