main: fix segfault introduced in last change