fix another stack overflow error. add test for #456