fixed a bug where logs weren't writter on fatal errors