implemented threading in testing