added controller for functions