Handle parse errors and upgrades properly
Example updated to handle parse errors