Uncaught TypeError: Cannot read property ‘fn’ of undefined