Fixed issue on script mode