fix resolveController function