fix rebuild bugs.