Removed if statement with try statement