change global variable username to local variable