added logger and switched to eventmachine