Emitting correct events when deleting a message