call cleanup method in route change