replaced lsof by nc to check for ports in use