Fix bug where callback was executed before the route was matched

Signed-off-by: Alexander Cogneau <alexander.cogneau@hotmail.be>