fix #977