fixed memory leak - free ifcount