remove debug, add (untested) isPortUsed