Fixing Handling exception