add code to deal with redis