There is no $isEditing in this function

Not completely sure this is the right fix, but it looks like it should work.