fixed variable conflict with library.
added exception handling if memcached is None