add test case and alternate fix for issue #54