wrapping innerText calls in helper function

Fixing sort error in Ink's issue #108