Fix bug error logs to files