add function fetchusername in globs.js