Code to free the Port