fixes for cross-browser compatibility