Whitespace fix

Add trim function to fix whitespace issue with names.