extended try-catch to catch an Unexpected NullPointerException