NPE fixed, issue 8