Added exception/error handling