fix script runs double bug