check for onclose callback