Handles exception if the port is in use