fixed #787