fix bug for batch operation