OpenLayers - marker popup text problem

Can anyone point me towards what have I missed here? The text displayed in all the popups is always “aa4”.

I have solved this using features rather than markers as per this example here:

However, I’m a still interested in what was going wrong in the code