adding code to support redis.