Additional fix for invalid ObjectIds