Added retry for failed login attempts