Fixing back button bug