correct thunk handling logic