Updated (with doc and app.lock())