After fixing the bug - function cant be called on non object