fixing infinite loop in GBKParser