set port to null before deleting