fix typo, improve logging