fixes segfault on Linux