trim and change tab