Fixed wron checking of log file