Thread problem fixed