tweak to getroworbefore
check for null