fixing a type error