Adding functionality to controller