fixed some bugs #26