fix the infinite issue