added code for cropping string