Added a hack to make it work on IE 8