update tick function