also fixed the reason why it was null
but still keep null checks if for another reason the map is null