fixed bug in main.c when calling hadvppm()