query device fix