changed callback function to have arguments of packet, index, total instead of packet, isDone