working. fix some bugs