Fix undefined function loadData

Looks like a missing check