added some log messages for trimming trailing whitespaces