Fixed a bug in main.c