fix some bugs from last testing