Added null check before sysout