added check if first line is empty