Fixed bug recursive script