fix type errors