Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type :17