more refactoring to it should be success
make sure the log has a predefined file