dirty fix for preventing segfault