fix bug when data is empty during commit