Add tick handler