fix bug

used "username" variable multiple times, rendering a condition
ineffective