change autocrop code