fixed #840