correct a segv in export