Fixes issue where newlines are not removed