added compatible logic for memcache