fixed error route using return function as arg.