adding name also to referenced class objects