still error in resampling