use history api if available