fix link bug & add some debug info