added unprotected reference fix when converting ObjectId's