Preview modal script fix