Fix back button handling