added a method to close the redis connection