FIX: distributed cache leak and potential infinite loop