Test of on_disconnect function