fixing the bug where objectid is None then it does not serialize it.