fixing type bug