error in memoizations