fixed a bug in the relative cropping