bug fix in controller