fixing issue 221
added a testcase for github issue 221