Fix deeds_for query issue