add warning on closing