fixes for cross-browser compability