fixed queries and setup process, all old functionality should work now