use digest instead of direct query