fix memory used, removing trailing spaces.