Implementing daemon mode