Fixed thread refresh problem