duplicate index entry - not quite working correctly