Some changes to get username method.