unexpected end of input - object is not a function