fix whitespace strip function