correcting type error