main.c: fix bug checking for wrong variable