added better error handling when redis connection is in trouble