func handle type error fix