Pass state through map functions properly