fixing segfaults again