updated design
fix some bugs