Made complete rebuild a separate thread