before main call