Attempt at fixing threads