added toJSON to collections