udpate for refresh and unregist logic
fix bugs