small readfile func fix