restructed redis settings for connection
added connection function for redis