change linkState to fix a bug