Used simpler method of determining user name
Fixed determination of username