added some code for redis