added defered close call for redis connection