updated to handle count + publish