Improve form validation