get rid of infinite error loop