bug fix and debug enable