fix main call within program bug