finish parse
fix some bugs