mainfunction decorator