improve cross-browser functions