replaced return statements with exit statements in python run scripts