Injected  but now getting undefined is not a function error