added IE8  compatible code