correct type errors