bug fixing: form validation