Fixing UID being nil

UID is returned as nil.This should fix it. Patch is untested