fixed server daemon and added logging for server, too.