modified function reset time