fix crash on nil value in a map