the original example will cause error:undefined is not a function