replacing the correct line