fix #787