adding a flush to commit