Layout changes and fixing back button functionality