Fix for IE8 javascript