fix frontend: Environment::read => check if end of stream;