improve check in fetch script