custom bson type handling