fixing the edit mode