solved bug on short straight-line