Lock counter



<!---
@huboard:{"order":115.0,"milestone_order":53.0,"custom_state":""}
-->

ehhhh...
we have a unit tested version in the set refactor branch :)