test for #397
fix #397 with this fugly hack