implmeneted looping fix

fixes bug in ie.