trim after null check