bug fix and code format.