close port when finished