fixed string is not a function error