Fix recursive lock