Updated to prevent locks