fixed #585