fix bug with reference to changed object