router working without global function