Add block_given check to keep old API call