add debug feature and fix checkSum calculation