added sql query..or at least tried to