fixed segfault in import API