fix some bugs (?)