add test for #535
fix #535