Added more cross-browser compatibility