fix script behavior