bugfixes for form validation