fix a exception because user isn't defined

this function can't work because user is never defined and it will raise anyway