fixed a typo in log
fixed a crash happening in very rare conditions