bug fixed for cycle reference