removed unused imports, catch the actual exception