fixed segfault on x86_64