Now use a global timer funtion