Added exception handling in the main function