crop function and crop rectangle draw added