Change setTimeout to setInterval.
Use local variable for caching result.