fix bugs with routes