Script frame glitch fix