fix linkup and linkdown issues