added crop mask function and mask obj