removed the call to exit(0) in main.cpp