#162 fixed some bugs