modified function-controller