fixed ref and test