Since using $read over and over can become slow, I'd suggest using /fopen in the "begin event", $fread when returning the popup items and /fclose in the end though.