rewrite semalock