only try to callback on close, when a callback is given