use seaparate function for setting route parameters

This fixes the regression made in #451