better error handling in main
fix error message