use closure instead of cmd