~ fix: moved the null check some lines above before appContext is being dereferenced