added logger, fixed livelock