implemented mutex locking the batch in construction