Filter out new lines from direction field