Fixed popstate for navigation