SD: Added locks and fixe save after delete