update style and fix some bugs