performance fix

using the result object offsetExists function instead of converting the
result to array then check the array key...