Change the order to solve error C2381: “exit”