Fix bags with lock for delete and close window