fix some bugs remaining