Fixed "undefined is not a function"