unset($ports) after file put contents!