main and thread updated