Handle html5 history better