fix for line calculation