Changed the way how lock works conforming to MVC