fix bug when deleting invalid pagings

query that fetches invalid pagings did not check
the func key type. We only want to delete pagings, not
everything.