fix some bugs and make pre wrap text