fixed extra end in controller