trim spaces in beginning and end first