Fixed rebuild bug