exception handling for ports already in use