corrected substring code to grab incoming ID