Corrected issues on threads