using threading for tasks