improve daemon and bugfixes