Detect added and removed elements