bug fixes for logging