fix for end in controller