fixed a bug where the OnQueryError callback wasn't called