fix uncaught TypeError: undefined is not a function

Occurs in latest Chrome and Firefox because of new Ecmascript 6 methods see http://www.sitepoint.com/preparing-ecmascript-6-new-array-methods/
In this case `data` is an array and has therefore a function "values" meaning it is no longer null