Task to process each item