fixed #997