added null value check for BsonObject/BsonArray