Changed code for IE bug