bugfix: read cap in lock