Added handling of back button