updated redis mode script