undefined trim fix