Using scheduler works, but now trying timer
Fixed code to use timer