fixed exception in controller