Thread problem solved