JS changes for IE9 compatibility