Add check null to avoid crash