moved task run try-catch to runTask()