fix #1128 should work but needs tested.