fixed yet another segfault - hope this was the last one