fixed the interval and added on_connected