error handling and main.exe