fixed bugs about resource linking!!