Make sure data exists before using it

Fixes #26
Merge pull request #27 from Keithbsmiley/data-fix

Make sure data exists before using it