Added null check.