added trims to control whitespace errors