fixed KPK bug in the js