moved history check to app router