Adjusted the read command when opening a file