cleanOldState now frees also the ip