adding timer functionality