Created conditions and new variables to manage the timers globally and reset the timeout every time new data is requested to the database.