cyclic referenses with constructor and function