fix some bugs and add Session library