adding test case; fixing bug