fix some bugs and rearrange the resource files