added improvement to -endEditingFrame