init lock related code