Fixed not a function error