re-implement on close