Use an iterator rather than that stupid lock boolean.