add scrolled window and fix some bugs