If there's an exception above, this line generates an UnboundLocalError for data since it never gets defined in this line.
data