reorder functions
check if the task function is reachable before sending message