type mismatches fixed