function and route_check added