add functions in controller