Added function to export a collection