new attempt at fixing back button handling