debug and add test
(#547)