attempt to get cross-browser compatibility to work consistently, safari is still really flaky