added pin query + output for debugging