fixed, sometimes an ferror was returned when using fread, switch to fgets like most other usage of popen