fixed if's goto bug