fix bug in Main.cpp