added template for crop, reinitialization fix