Fix stack overflow bug in ie