fix completion; add batch mode