cleaned up port-freeing