updated to allow instance ID instead of port num