tweak query for resetting pin states