bug fixes, form validation