add queue and timer to force write to sql in every 1 sec