Fixes lock issue