Fixes back button navigation bug