add db filtering hook.