cycle detect bug fixed.