set result = null on error