fixed error handling in route methods