Fixed bug in main.c