use chomp instead of regex to remove known last character