fixing type query