Initialize $data in case there are no results

When no results, $data is uninitialized which causes an error when trying to access it.