Added extra fix to avoid NULL dereference