preparations for daemon mode