fixed bugs with cropping