modified login script to fix bug where user could not login after having logged out.