Updated memcache implementation