fixed #880 fixed #858