adding logic for successful logins