modified exit script