Code changes for IE8 compatibility