Fixed bug with route changes