fixed memory leak issue when referencing data instances from data instances