fix some bugs on each helper function