fixed errors but left with incompatible types