fixed history and url handling