Fix error when signin in twice. Sign in automatically after registering