use proc and fetch instead of block and magic var