added popstate functionality
Merge branch 'popstate'