Add a validation for returned context.