fix error with 'undefined' username on first login