Added fix for extracting username in principal value