scripts fixed for some cases