Fix auto renew thread code