adding null safeguard