Fixed issue with whitespace at the end of file
Added exception use statement