fixing a small bug where both routes are triggered