bug fix in batch script