changed reference handling