fixed path and fgets() change to fopen() is correct