add keyArg to edit function