Added a count to check if the current block is the last block so a CSS class can be conditionally added