Can you post the script? Otherwise it's hard to tell where the stop became wrong.