wrapping Dial inside an anonymous function