define methods in controller