execute content in blocks for improved error handling
don't unset foreach vars