Updated for IE8 compatibility