another  fix  to problem in main.cpp