debug fix and bug fix