Fix for cross-browser compatibility