working on keyref