adding null reference safety