runs when the amount of lines change