fix segfault (as usual, stupid error)