fixed another problem

should add test cases for this