fix error in preparation