fixed infinite loop in spider.