fixed problems, made browser compatibility