Use correct SQL query in loadData method