Fix worker to clear batch only when its request has succesfully finished