fix back button behaviour