rebuild to valid