Readded query functions after strange rollback