added support for IE8, bug fixes