fixes for check function

function now correctly pulls line numbers from its calls