resolves #613 and adds a test case