fixed a bug in route handler method