updated to retry login on failur