fixed form validation (fixed #39)