workaround bug in gcc causing segfault