Updated LoginGen with correct substring value