fix infinet loop