fix cross-browser compatibility