Improved code of memcached widget