improved threading tests