Fixed bug in postToCollection.