adding better debug/logging and timeout vs interval