fixed thread join issue