fixing a type bug