Fixed query issue for resources