add refresh port function