Adds if statement to timer