Fixed small bug in timer