added batch size management (from other client reverse eng.)