Added a check to avoid empty objectID