fixed login bug with nil @user