fixed error 'string is not a function'