fix based on test case from jw