fixed controller test error
fixed failing controller test
refactored form validation