bug fix and merge