added time to tick function