You can use findTask instead. So you can use task instead of task[0]