adding unit test for locking