[Issue #5]Fixed error on automatic login after registering