Fixed Back button functionality