fixed some cropping code