avoid infinity loop