Database queries now work