update lock before release