Updated code for new chunx version