fix prepare data