sql queries now work