Fixed crash when pressing back button