Login logic updated