fix log messages to cover undefined varibable