- cleanup
- added a timeout before close, because that may be needed