fix type bugs