Added null check to avoid crash at