logic in controller