Added clock tick event handler