adding exit_code for list_ports