Be more careful when editing the collections

- Do not update a collection twice
- Do not update a collection if it hasn't changed