added proper clearing of the routes