fix redis flush and test flush on before