fix some bugs and upgrade view