daemon mode tested and working with sqlite message queue, messy implementation