callback is only executed when the outmost block returns a value