constructing dictionary if != nil