only add custom fields if previous key exists