2nd try at fixing the NPE