specifying where the error is in the function for lockState