fixes for issue #2, browser compatibility