fix for global functions into main controller