now reading file correctly