fixed case where result() is called on non object; the error is not verbose so adding this check makes it a little more verbose