bug in controller and validation check