fixed logging to file