Added a generic function to update subarray
Remove var stats for the callback because this var is available directly with the client object