fixed union segfault