fix some bugs and change layout