Fixed bug with reading from file - processed 2 times in a row