run in batch mode