compaction multiple \0 characters in the end fix