Fix bug when updating collection