move line inside map null check