improved error handling in main.cpp