fixed the "no login after registration" bug