fixes type errors