Table queries working in app