bug fix and added one new test