added query stuff