Correct script logic