modified the mutation handler (more stable)