changed time function