logic to identify edit event