modified in order to support memcached