bug fix and adjust