fixed serialize to support ObjectID & Date types