fixed reference handling