fixed the memoization table check