switching the logic to catch the error where it doesn't exist