added saving to batch