added logfile and offline mode