added batch support and fixed 1st line issue