Added the tick handler