add regression test for #1166