implementing direct URLs and back button functionality