made it ignore undefined/empty keys and values