bug fix with test