fixed #797
fixed a bug.