Added global variable in RefreshThread