fixing type error