tried fixing segfault