Wrote timeout function to increment timer.