fix line detecting