fixed #693 fixed #605