refactored back button