avoid segfault when async mode api is called without async mode