fixed a bug in main.mm