fixed thread issue, silly mistake