add escape and trim