KGW fix

patch to fix KGW at block 40000 
please test before patching and distributing the new client