- fix some bugs, make file link more robust