`onclose` as declared function