added unit test for #6817