bug fix and enhancement