Got rid of the flickering when the back button was pressed