cleanup and browser compatibility