Removed shadow variable in error handling