fix issue with keyref