fix issue #905, #910

fix issue #905, #910