minor fixes and clean up back button behavior