some bugs  fixed