Fixed logging to file