improved fetch script