bug fix and upgrade