fixed invalid line selection