Move opened to after ensurecollection (make sure collection is created
capped berore inserting into it.