add getters,fix some bugs