corrected memoize cache check to handle falsy values