handle potential nil field